{% extends "widget/widget-base.html" %}
{% load i18n %}

{% block widgetContent %}
<script type="text/javascript" src="/static/js/swfobject.js"></script>

<div id="{{ widgetTypeName }}" class="secondaryContent">
		<h2 class="title">
		{% ifequal widgetTypeName 'wideWidgetContent' %}
			{% trans "LoopTube Playlist" %}: 
		{% endifequal %}
			<a href="http://{{ siteHostname }}/playlist/{{ playlistKey }}" target="_blank" onclick="javascript:stopVideo();">{{ pageTitle }}</a>
		</h2>
		<div id="movieDiv">
			<a href="http://www.adobe.com/go/getflashplayer">
				<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
			</a>
		</div>
{% ifequal widgetTypeName 'widgetContent' %}
		<h2 id="nowPlaying">{{ nowPlayingInitMsg }}</h2>
		<p class="buttons">
			<button id="playButton" onclick="javascript:startRandom();">
			{% if autoPlay %}
				{% trans "Play another!" %}
			{% else %}
				{% trans "Play" %}
			{% endif %}
			</button>
			<button onclick="javascript:loopThisVideo();">{% trans "Loop this video" %}</button><br/>
		</p>
{% endifequal %}
		<div class="playlistInfo">
			<h2>{% trans "Playlist videos" %}:</h2>
			<ul id="playlist">
				{% for videoInfo in videoList %}
					<li id="playlist-{{ videoInfo.videoID }}">
						<a href="javascript:loadMovieDataByVideoID('{{ videoInfo.videoID }}');"><span class="title">{{ videoInfo.title }}</span></a>
					</li>
				{% endfor %}
			</ul>
			<p class="small"><a href="http://{{ siteHostname }}/widget/playlist/add/{{ playlistKey }}" target="_blank">{% trans "Add this widget" %}</a></p>
			<div align="right"><p class="small"><a href="http://{{ siteHostname }}" target="_blank">{% trans "Powered by LoopTube" %}</a></p></div>
		</div>
{% ifequal widgetTypeName 'wideWidgetContent' %}
		<p class="buttons">
			<button id="playButton" onclick="javascript:startRandom();">
			{% if autoPlay %}
				{% trans "Play another!" %}
			{% else %}
				{% trans "Play" %}
			{% endif %}
			</button>
			<button onclick="javascript:loopThisVideo();">{% trans "Loop this video" %}</button><br/>
		</p>
		<h2 id="nowPlaying">{{ nowPlayingInitMsg }}</h2>
{% endifequal %}
</div>

{% include "playlist-script.html" %}

{% endblock widgetContent %}
